3 visuals for webpage

This code will help produce the three visuals that are going to be a part of each equity tracker indicator webpage: regional map (tract level) of most recent data, chart of the most recent data, chart of trends over time.

If the indicator is available through a tract-level data set. Getting the data to a workable version may require some data transformation. To explore, clean, transform, and generate a final data set, please use the data-gen-tract-template. This script will generate an .rda for the map and an .rda for the charts. These data sets will be loaded in before the data visualization code.

Indicator Explanation

The release of toxic waste materials into the surrounding environment has a negative impact on peoples’ health and the environment in general. Differences between groups of people can highlight differing levels of exposure to toxic release. For this indicator, we are measuring the concentration of toxic site release as the pounds of release emitted within a two-mile buffer divided by the area of the buffer in acres, per census tract within the buffered zones.

1. Map of most recent data

To map data in this form, there should be a value corresponding to each census tract. Depending on the year or source of the data, this could be about 700 rows for data at the 2010 census tract resolution, or about 900 rows for data at the 2020 census tract resolution.

Create Visual

Source(s): U.S. Environmental Protection Agency, Toxics Release Inventory Program, 2024; U.S. Census Bureau, Geography Division 2020 TIGER/Line Shapefiles



Data call outs

  1. 15.0 lb/acre: The highest concentration of toxic site release in the region
  2. 1/2: Nearly half (48%) of census tracts in the region have no amount of toxic site release
  3. 74%: The toxic site release exposure decreased 74% between 2014 and 2024 for communities with high concentrations of people of color


Insights & Analysis

  • The three census tracts with the highest concentration of toxic site release are in Pierce County (Lakewood, north of Joint Base Lewis-McChord; Eastside neighborhood in Tacoma); the next four are in King County (Houghton, Lakeview, Moss Bay, and South Rose Hill neighborhoods in Kirkland).
  • Pierce and Kitsap Counties have an average concentration of toxic site release higher than the regional average; King and Snohomish Counties are lower than the regional average.
  • 67% of the tracts in the region (620/919) experience less than 0.1 lb/acre toxic site release exposure.



2. Facet of most recent data

Create Visual

Toxic Releases by Community

Pounds per acre within 2 miles of release sites

U.S. Environmental Protection Agency, Toxics Release Inventory Program, 2024; U.S. Census Bureau, 2020-2024 American Community Survey 5-Year Estimates, Tables B02001, C17002, B22010, B11005, B11007, C16002

Data call outs


Insights & Analysis

  • Communities in the region with the highest concentration of people of color have 145% higher toxic site release exposure than communities with the lowest concentration of people of color - 1.2 lb/acre and 0.5 lb/acre, respectively.
  • The average concentration of toxic site release is 2 times higher in communities with the highest concentration of low income households (1.9 lb/acre) than in tracts with the lowest concentration of low income households (0.9 lb/acre).
  • In Snohomish County, communities with the highest concentration of households with limited English proficiency experience higher rates of toxic site release exposure than communities with the lowest concentration with differences ranging - a 1.6 lb/acre difference. The difference in King and Pierce are smaller - 0.1 lb/acre and 0.3 lb/acre, respectively.
  • Communities with the highest concentrations of people with a disability have higher toxic site release exposure compared to communities with the lowest concentrations of people with a disability in Pierce and Snohomish counties (55% and 82% higher, respectively),
  • There is no consistent trend for communities with higher and lower concentrations of households with youth and households with older adults.



3. Facet of trend data

Create Visual

Toxic Releases Trend by Community

Pounds per acre within 2 miles of release sites, in 5-year spans between 2014 and 2024

U.S. Environmental Protection Agency, Toxics Release Inventory Program, 2014, 2019, 2024; U.S. Census Bureau, 2010-2014, 2015-2019, 2020-2024 American Community Survey 5-Year Estimates, Tables B02001, C17002, B22010, B11005, B11007, C16002

Data call outs


Insights & Analysis

  • From 2014 to 2024, toxic site release exposure decreased for communities with the highest concentrations of low income households - the largest decreases was in Pierce County (86%), followed by King (63%), Kitsap (51%), and Snohomish (19%).
  • In Pierce County, communities with the highest concentration of people with disabilities saw significant decreases in the concentration of toxic site release, from 15.1 lb/acre in 2014 to 1.9 lb/acre in 2024.
  • Between 2019 and 2024, the difference in toxic site release exposure between communities with the highest and lowest concentrations of households with limited English proficiency decreased in all counties, except for Snohomish County, where the gap increased from 1.2 to 1.5 lb/acre.
  • Across the region, toxic site release exposure decreased for most communities between 2014 and 2024, especially in Pierce County.



Transfer files

Copy files from Github > Y drive/update folder

This step will transfer all of the Rmd output files (html and docx) to the network for review. It will keep the Rmd files within GitHub so that code is kept in a central place. Always run this chunk of code. If this is the first time you are generating visuals for an indicator, comment out the ‘update’ part of the ‘y.drive.folder.update’ variable because this is the first version that is being created.

Copy files from Y drive/indicator folder > Y drive/indicator/archive folder

This step will transfer the previous data and files to the archive folder. This step is meant to retain the older versions in case they are needed for reference. Only run this chunk of code if updating visuals for indicator - if there is already existing visuals on a webpage. Don’t run if this is the first time visuals are being created for indicator.

Delete old files from indicator folder

This step will clean the indicator folder to make room for the new versions. Only run this chunk of code if updating visuals for indicator - if there is already existing visuals on a webpage. Don’t run if this is the first time visuals are being created for indicator.

Copy new files from Y drive/update folder > Y drive/indicator folder

This step will move all of the updated data/files to the general indicator folder. They should be moved from the update (draft staging directory) to the parent folder so that the htmls can be copied to the webpage folder (outside the firewall). Only run this chunk of code if updating visuals for indicator - if there is already existing visuals on a webpage. Don’t run if this is the first time visuals are being created for indicator.

Clear Y drive/update folder

This step will help keep the folders organized and ready for the next update. Only run this chunk of code if updating visuals for indicator - if there is already existing visuals on a webpage. Don’t run if this is the first time visuals are being created for indicator.

Copy files from Y drive/indicator folder > website folder

This step copies the htmls for the webpage (3 visuals) from the network to the folder outside the firewall- this ‘external’ folder connects directly to the webpage. Always run this chunk of code.

Back to top of the page